package com.itheima.mapper;

import com.itheima.pojo.Setmeal;
import com.itheima.pojo.SetmealDish;
import com.itheima.vo.SetmealByIdVo;
import com.itheima.vo.SetmealVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealMapper {

    //套餐分页
    List<SetmealVo> page(String name, Integer start, Integer pageSize);

    //计算 total(总条数)
    long countSetmeal();

    SetmealByIdVo getSetmealById(String id);

    List<SetmealDish> getSetmealDishById(String setmealId);

    int addSetmeal(Setmeal setmeal);

    int batchInsertSetmealDish(@Param("list") List<SetmealDish> list);

    int updateSetmeal(Setmeal setmeal);

    int countSetmealDish(String setmealId);

    int removeSetmealDishById(String setmealId);

    boolean status(@Param("status") Integer status, @Param("ids") List<String> ids);

    boolean deleteSetmeal(List<String> ids);

    int deleteSetmealDish(List<String> ids);

    List<Setmeal> getSetmealByIdStatus(String categoryId, Integer status);
}
